# writer:sp
# tiem: 2024/8/15 10:38
# def repeat(n):
#     def decorator(func):
#         def wrapper(*args, **kwargs):
#             for _ in range(n):
#                 results = []
#                 result = func(*args, **kwargs)
#                 results.append(result)
#             return result
#         return wrapper
#     return decorator
# @repeat(3)
# def greet(name):
#     print(f"Hello, {name}!")
#     return f"Greeting for {name}"
# greet("Alice")
def repeat(n):
    def decorator(func):
        def wrapper(*args, **kwargs):
            results = []
            for _ in range(n):
                result = func(*args, **kwargs)
                results.append(result)
            return results
        return wrapper
    return decorator

@repeat(3)
def greet(name):
    print(f"Hello, {name}!")
    return f"Greeting for {name}"

greet("Alice")
